package cn.bytecollege.controller;

import cn.bytecollege.service.VipService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "VipDeleteController", value = "/vipDelete")
public class VipDeleteController extends HttpServlet {
    VipService vipService=null;
    public VipDeleteController(){
        vipService=new VipService();
    }
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id=request.getParameter("id");
        int vipId=Integer.parseInt(id);
        vipService.delete(vipId);
        //response.sendRedirect(request.getContextPath()+"/vipList");
    }
}
